import Layout from '@/layout/index.vue'

const configRouter = {
  path: '/sys-config/',
  component: Layout,
  redirect: 'noRedirect',
  name: '配置管理',
  meta: {
    title: '配置管理',
    icon: 'lock',
    roles: ['sys:config-type:page']
  },
  children: [
    {
      path: 'type/index',
      component: () => import('@/views/sys/config/type/index'),
      name: '配置分类',
      meta: { title: '配置分类', noCache: true, roles: ['sys:config-type:page'] }
    },
    {
      path: 'data/index/:id(\\d+)',
      component: () => import('@/views/sys/config/data/index'),
      name: '配置数据',
      meta: { title: '配置数据', noCache: true, activeMenu: '/sys-config/type/index' }, // 这里的activeMenu很重要
      hidden: true
    },
    {
      path: 'value/index/:id(\\d+)',
      component: () => import('@/views/sys/config/value/index'),
      name: '配置内容',
      meta: { title: '配置内容', noCache: true, activeMenu: '/sys-config/type/index' }, // 这里的activeMenu很重要
      hidden: true
    },
    {
      path: 'log/index',
      component: () => import('@/views/sys/config/log/index'),
      name: '配置日志',
      meta: { title: '配置日志', noCache: true, roles: ['sys:config-log:page'] }
    }
  ]
}

export { configRouter }
